package cn.sample.moreitems.event;

import cn.sample.moreitems.MoreItems;
import cn.sample.moreitems.init.ModMenu;
import cn.sample.moreitems.init.ModParticles;
import cn.sample.moreitems.particle.CustomExplosionParticle;
import cn.sample.moreitems.particle.Provider;
import cn.sample.moreitems.screen.TechnologyScreen;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.MenuScreens;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.event.RegisterParticleProvidersEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;

@Mod.EventBusSubscriber(modid = MoreItems.MODID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
public class ClientSetup {


    @SubscribeEvent
    public static void registerParticleFactories(RegisterParticleProvidersEvent e) {

        e.registerSpriteSet(
                ModParticles.CUSTOM_EXPLOSION.get(),
                Provider::new);
    }

    @SubscribeEvent
    public static void onClientSetup(FMLClientSetupEvent event) {
        event.enqueueWork(() -> MenuScreens.register(ModMenu.THROWN_ROCK.get(), TechnologyScreen::new));
    }

}